#pragma once
#include "ComDef.h"
#include "game_util/event_mgr.h"
#include "acc_driver.h"

class RelaPlayerMain;
class RelaPlayer;

class RelaNet 
{
	RelaPlayer& m_owner;
	WeakPtr<proto::Session> m_sn;
	Timer m_offlineTimer;
	su::Timer m_waitReleaseTimer; 

public:
	LoginState m_state = LoginState::Logout;

public:
	RelaNet(RelaPlayer& data);
	~RelaNet();

	void Login(const Session& sn);
	void OnClientDisCon();
	void Logout();
	void DelSession();
	void SetState(LoginState state);
	void SendToClient(uint32 cmd, const std::string& msg);
	void SetWaitRelease(bool enable);
};
